#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll sum, ans;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t; cin >> t;
    while (t--) {
        int n; cin >> n;
        sum = 0, ans = 0;
        for (int i = 1; i <= n; i++) {
            int x; cin >> x;
            sum += x;
            if (x == 0) ans++;
        }
        if (sum == 0) ans++;
        cout << ans << '\n';
    }
    return 0;
}